<!--
 * @Author: CHINAKAIYUAN<sunkaiyuan@namenode.cn>
 * @Date: 2022-02-03 14:41:20
 * @LastEditTime: 2023-10-29 13:43:04
 * @LastEditors: 孙开源 && sunkaiyuan@namenode.cn
 * @Description:   :gridOps="gridOptions" 
-->
<template>
  <sc-VxeTable
    :gridEvts="gridEvents"
    :tablecode="'storage_query_batch'"
    ref="xGrid"
    :gridOps="gridOps"
    :url="this.$API.storage.storage.batch"
    :params="[{ available_quantity: { type: 'gt', value: 0 } }]"
  >
  </sc-VxeTable>
  <list-dialog
    v-if="dialog.listDialog"
    ref="listDialog"
    @closed="dialog.listDialog = false"
    :params="list_params"
  ></list-dialog>
</template>

<script>
import { ref, nextTick } from "vue";
import listDialog from "./../list";
export default {
  components: { listDialog },
  name: "storage_query_batch",
  setup() {
    const list_params = ref({});
    const xGrid = ref({});
    const dialog = ref({
      listDialog: false,
    });
    const listDialog = ref({});
    const gridEvents = ref({
      cellDblclick: function ({ row }) {
        dialog.value.listDialog = true;
        list_params.value = {
          summary_storage_id: { type: "in", value: row.id.split(",") },
        };
        nextTick(() => {
          listDialog.value.open();
        });
      },
    });
    //
    const gridOps = {
      columns: [
        {
          field: "available_auxiliary_quantity",
          className: "blue",
        },
        {
          field: "available_quantity",
          className: "blue",
        },
      ],
    };

    return {
      gridEvents,
      list_params,
      dialog,
      gridOps,
      listDialog,
      xGrid,
    };
  },
};
</script>
